unit ConnectTo;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TfmConnectTo = class(TForm)
    cmbPunkt: TComboBox;
    btnOk: TButton;
    Label1: TLabel;
    cmbIP: TComboBox;
    IP: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure cmbPunktChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmConnectTo: TfmConnectTo;

implementation
uses DM;
{$R *.DFM}


procedure TfmConnectTo.FormCreate(Sender: TObject);
begin
  with dmData do begin
    qTmp.Close;
    qTmp.SQL.Text := 'SELECT SHORTNAME, IP FROM PUNKTS WHERE IP IS NOT NULL';
    qTmp.Open;
    QryToStrings(qTmp, 'SHORTNAME', cmbPunkt.Items);
    QryToStrings(qTmp, 'IP', cmbIP.Items);
   end;

end;

procedure TfmConnectTo.cmbPunktChange(Sender: TObject);
begin
  cmbIP.ItemIndex := cmbPunkt.ItemIndex;
end;

end.
